home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 23 / AACD 23.iso / AACD / Programming / tek / visual / flush.c < prev    next >
C/C++ Source or Header  |  2001-05-18  |  635b  |  37 lines

  1.  
  2. #include "tek/visual.h"
  3. #include "tek/debug.h"
  4. #include "tek/kn/visual.h"
  5.  
  6. /* 
  7. **    TEKlib
  8. **    (C) 2001 TEK neoscientists
  9. **    all rights reserved.
  10. **
  11. **    TVOID TVFlush(TAPTR visual)
  12. **
  13. **    sync/expose.
  14. */
  15.  
  16. TVOID TVFlush(TAPTR visual)
  17. {
  18.     TVISUAL *v = (TVISUAL *) visual;
  19.     TDRAWMSG *msg;
  20.  
  21.     for (;;)
  22.     {
  23.         if ((msg = TGetMsg(v->asyncport)))
  24.         {
  25.             msg->jobcode = TVJOB_FLUSH;
  26.  
  27.             TSendMsg(v->parenttask, TTaskPort(v->task), msg);            
  28.  
  29.             kn_lock(&v->asyncport->lock);
  30.             TAddTail(&v->asyncport->msglist, (TNODE *) (((TMSG *) msg) - 1));
  31.             kn_unlock(&v->asyncport->lock);
  32.             return;
  33.         }
  34.         TWaitPort(v->asyncport);        /* wait for free node */
  35.     }
  36. }
  37.